package com.example.glboardtest1;

import javax.microedition.khronos.opengles.GL10;

public class Cursor {
	private float cursorX = 0.0f;
	private float cursorY = 0.0f;
	private float cursorZ = 0.0f;
	
	private int angle = 0;
	
	public Cursor() {
		clearCursor();
		clearAngle();
	}
	
	public void reset(){
		clearCursor();
		clearAngle();		
	}
	
	public void clearCursor(){
		cursorX = 0.0f;
		cursorY = 0.0f;
		cursorZ = 0.0f;
	}
	
	public void moveCursor(float x, float y , float z, GL10 gl){		
		gl.glTranslatef(x - cursorX, y - cursorY, z -cursorZ);		
		cursorX = x;
		cursorY = y;
		cursorZ = z;
	}
	
	public void clearAngle(){
		angle = 0;
	}
	
	public void rotate(int v, GL10 gl){
		gl.glRotatef(v - angle, 1, 0, 0);
		angle = v;
	}
}
